using System;
using needle.Services.astra.Common;

namespace needle.Services.astra.Collections
{
	/// <summary>
	/// Document interface.
	/// Document implementing this interface must be a class to work well with <see cref="Documents"/>.
	/// </summary>
	public interface IDocument : IParentWritable<Documents>
	{
		/// <summary>
		/// Uri of this document.
		/// <seealso cref="IsNew"/>.
		/// </summary>
		Uri Uri
		{
			get;
			set;
		}
		/// <summary>
		/// Document name.
		/// </summary>
		string Name
		{
			get;
		}
		/// <summary>
		/// Whether this document is open as read only.
		/// </summary>
		bool IsReadOnly
		{
			get;
			set;
		}
		/// <summary>
		/// Whether this document is new and not saved yet.
		/// </summary>
		/// <value><see cref="Uri"/> is null.</value>
		bool IsNew
		{
			get;
		}
		/// <summary>
		/// Whether this document is changed and needs to be saved.
		/// See <see cref="Data"/> for more information.
		/// This can be also set manually.
		/// </summary>
		bool IsChanged
		{
			get;
			set;
		}
		/// <summary>
		/// Document data.
		/// </summary>
		/// <remarks>
		/// If changed, sets <see cref="IsChanged"/> to true.
		/// </remarks>
		object Data
		{
			get;
			set;
		}
	}
}
